package net.stock.domain;

/**
 * @author naim
 * @date Dec 23, 2009
 */
public class ItemPrice implements Comparable {
    private String item;
    private Float price;
    private Float myPrice;

    private boolean low;
    private boolean high;

    public ItemPrice() {
    }

    public ItemPrice(String item, Float price) {
        this.item = item;
        this.price = price;
    }

    public ItemPrice(String item, Float price, boolean low, boolean high) {
        this.item = item;
        this.price = price;
        this.low = low;
        this.high = high;
    }

    public ItemPrice(String item, Float price, Float myPrice, boolean low, boolean high) {
        this.item = item;
        this.price = price;
        this.myPrice = myPrice;
        this.low = low;
        this.high = high;
    }

    public String getItem() {
        return item;
    }

    public void setItem(String item) {
        this.item = item;
    }

    public Float getPrice() {
        return price;
    }

    public void setPrice(Float price) {
        this.price = price;
    }

    public Float getMyPrice() {
        return myPrice;
    }

    public void setMyPrice(Float myPrice) {
        this.myPrice = myPrice;
    }

    public boolean isLow() {
        return low;
    }

    public void setLow(boolean low) {
        this.low = low;
    }

    public boolean isHigh() {
        return high;
    }

    public void setHigh(boolean high) {
        this.high = high;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ItemPrice itemPrice = (ItemPrice) o;

        return item.equals(itemPrice.getItem());

    }

    public int hashCode() {
        return item.hashCode();
    }

    public int compareTo(Object o) {
        ItemPrice itemPrice = (ItemPrice) o;
        return item.compareToIgnoreCase(itemPrice.item);
    }
}
